package link;

/**
 * 链表的测试主函数
 * Created by zhaoxin on 2018/7/19.
 */
public class Main {

    public static void main(String[] args) {

        LinkedList<Integer> linkedList = new LinkedList<>();
        for (int i = 0; i < 10; i++) {
            linkedList.addLast(i);
        }

        linkedList.addFirst(666);
        linkedList.add(3, 8888);
        System.out.println(linkedList);
        System.out.println(linkedList.get(0));


        linkedList.remove(2);
        System.out.println(linkedList);
        linkedList.removeFirst();
        linkedList.removeLast();
        System.out.println(linkedList);
    }
}
